<?php $view->extend('admin/realm', 'content', array('title' => 'Player start items')); ?>

<h2>Player starting items</h2>
<p>Here you can modify the player starting items for each class. Useful for fun servers and when you want a player to start with certain items.</p>

<?php echo $startForm;?>

<p>
<label>Class</label>
<select name="class" id="classChooser">
	<?php foreach($classes as $id => $class):?>
		<option value="<?php echo $id;?>"><?php echo ucfirst($class)?></option>
	<?php endforeach;?>
</select>
</p>

<div class="row">
<div class="col c3">
<p>
<label>ItemID and amount</label>
<?php echo $startForm->textarea('itemamount',null, array('cols' => 30, 'rows' => 30, 'id' => 'wowItemsChar'))?>
</p>
</div>
<div class="col c3">
<div class="message info">
<p>Notice, define item ids like so:</p>
<p>
<strong>ITEM_ID : AMOUNT</strong><br />
1992:2<br />
2312<br />
3232:4<br />
21333<br />
23123<br />
</p>
</div>
</div>
</div>


<p>
<?php echo $startForm->input('submit','submit','Save items')?>
</p>

<?php echo $startForm->close();?>
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready(function(){ 
	$('#classChooser').change(function(){
		$.get('<?php echo $view->url->linkTo('Admin','startitems', array($realm->id))?>/'  + $('#classChooser').attr('value'), function(data) {
			  $('#wowItemsChar').html(data);
		});
	}).change();
});
/* ]]> */
</script>